﻿namespace RndMaterialDisposalService.Models.RequestModel
{
    public class SmallBatchTrialElectronFlowReq
    {
        //1.试用申请
        public TrialApplicationModel? trialApplication { get; set; } = new TrialApplicationModel();
        //2.过程跟踪（跟踪工程师）
        public SmallBatchTrialTask1Model? task1 { get; set; } = new SmallBatchTrialTask1Model();
        //3.试制评审（相关工程师）
        public SmallBatchTrialTask3Model? task3 { get; set; } = new SmallBatchTrialTask3Model();
        //4.试制结论（质量经理）
        public SmallBatchTrialTask4Model? task4 { get; set; } = new SmallBatchTrialTask4Model();
        //5.试制结论（产品线总监）
        public SmallBatchTrialTask5Model? task5 { get; set; } = new SmallBatchTrialTask5Model();

        //上传附件
        public List<Attachment> UploadFiles { get; set; } = new List<Attachment>();
        public FormHeader formHeader { get; set; } = new FormHeader();
        //物料跟踪明细
        public List<MaterialTrackingDetails> materialTrackingDetailsList { get; set; } = new List<MaterialTrackingDetails>();
    }

    //1.试用申请
    public class TrialApplicationModel {
        //试用来源
        public string? TrialSource { get; set; }
        //物料替代电子流链接
        public string? ElectronicFlowLink { get; set; }
        //原物料编码
        public string? RawMaterialCode { get; set; }
        //原产品型号
        public string? RawProductType { get; set; }
        //原生产厂家
        public string? RawManufacturer { get; set; }
        //新物料编码
        public string? NewMaterialCode { get; set; }
        //新产品型号
        public string? NewProductType { get; set; }
        //新生产厂家
        public string? NewManufacturer { get; set; }
        //OEM
        public bool? Oem { get; set; }
        //试制物料备料方
        public string? MaterialPreparationParty { get; set; }
        //试用背景
        public string? TrialBackground { get; set; }
        //试用目的
        public string? TrialObjective { get; set; }
        //试用加工过程重点关注事项
        public string? KeyConcerns { get; set; }
        //跟踪工程师
        public string? TrackingEngineer { get; set; }
        //跟踪工程师ID
        public string? TrackingEngineerId { get; set; }
        //器件工程师
        public string? ComponentEngineer { get; set; }
        //器件工程师ID
        public string? ComponentEngineerId { get; set; }
        //外协SQE
        public string? OutsourcingSQE { get; set; }
        //外协SQEID
        public string? OutsourcingSQEId { get; set; }
        //外协工艺工程师
        public string? OutsourcingEngineer { get; set; }
        //外协工艺工程师ID
        public string? OutsourcingEngineerId { get; set; }
        //抄送人员
        public string? CCPersonnel { get; set; }
        //抄送人员ID
        public string? CCPersonnelId { get; set; }
        //SQE工程师
        public string? SQEEngineer { get; set; }
        //SQE工程师ID
        public string? SQEEngineerId { get; set; }
        //试制结论（质量经理）环节审批人名称
        public string? Task4ProcessApprovalName { get; set; }
        //试制结论（质量经理）环节审批人ID
        public string? Task4ProcessApprovalId { get; set; }
        //试制结论（产品线总监）环节审批人名称
        public string? Task5ProcessApprovalName { get; set; }
        //试制结论（产品线总监）环节审批人ID
        public string? Task5ProcessApprovalId { get; set; }
    }

    //2.过程跟踪（跟踪工程师）
    public class SmallBatchTrialTask1Model
    {
        //审核结论
        public string? Approval { get; set; }
        //试用范围物料跟踪明细
        public List<TrackMaterialTrackingDetails> determineTrackMaterialTrackingList { get; set; } = new List<TrackMaterialTrackingDetails>();
        //主流程与子流程关联信息
        public List<ProcessAssociatedInformationModel> processAssociatedInformationList { get; set; } = new List<ProcessAssociatedInformationModel>();
        //本次试制加工数量
        public string? ThisProcessingCount { get; set; }
        //是否需要相关工程师审批
        public bool? IsEngineerApproval { get; set; }
        //异常分析电子流
        public string? AnomalyAnalysisProcess { get; set; }
        //异常是否与试制物料有关
        public bool? IsAbnormalMaterialRelated { get; set; }
        //是否转产试制
        public bool? IsTransitionToTrialProduction { get; set; }
        //综合意见
        public string? Comment { get; set; }
        //审批人
        public string? ApproveName { get; set; }
        //审批人ID
        public string? ApproveNameId { get; set; }
    }

    //3.试制评审（相关工程师）
    public class SmallBatchTrialTask3Model
    {
        //会签信息
        public List<CountersignInformationModel> CountersignInformationList { get; set; } = new List<CountersignInformationModel>();
        //试制结论
        public bool? TrialProductionConclusion { get; set; }
        //成品处理方式
        public bool? FinishProductHandlingMethod { get; set; }
        //原材料/半成品处理方式
        public string? RawMaterialHandlingMethod { get; set; }
        //后续操作
        public List<string> SubsequentOperations { get; set; } = new List<string>();
        //说明
        public string? Comment { get; set; }
    }

    //4.试制结论（质量经理）
    public class SmallBatchTrialTask4Model
    {
        //试制结论
        public bool? TrialProductionConclusion { get; set; }
        //成品处理方式
        public bool? FinishProductHandlingMethod { get; set; }
        //原材料处理方式
        public string? RawMaterialHandlingMethod { get; set; }
        //半成品处理方式
        public string? SemimanufacturesHandlingMethod { get; set; }
        //限制范围/其他方式
        public string? RestrictedScopeOtherMethods { get; set; }
        //后续操作
        public List<string> SubsequentOperations { get; set; } = new List<string>();
        //是否需要总监审批
        public bool? IsDirectorApproval { get; set; }
        //备注
        public string? Comment { get; set; }
        //抄送
        public string? CCUser { get; set; }
        //抄送ID
        public string? CCUserId { get; set; }
        //审批人
        //public string? ApproveName { get; set; }
        //审批人ID
        //public string? ApproveNameId { get; set; }
    }

    //5.试制结论（产品线总监）
    public class SmallBatchTrialTask5Model
    {
        //试制结论
        public bool? TrialProductionConclusion { get; set; }
        //成品处理方式
        public bool? FinishProductHandlingMethod { get; set; }
        //原材料处理方式
        public string? RawMaterialHandlingMethod { get; set; }
        //半成品处理方式
        public string? SemimanufacturesHandlingMethod { get; set; }
        //限制范围/其他方式
        public string? RestrictedScopeOtherMethods { get; set; }
        //后续操作
        public List<string> SubsequentOperations { get; set; } = new List<string>();
        //备注
        public string? Comment { get; set; }
        //抄送
        public string? CCUser { get; set; }
        //抄送ID
        public string? CCUserId { get; set; }
    }

    //物料跟踪明细
    public class MaterialTrackingDetails
    {
        //主键
        public int? key { get; set; }
        //产品线
        public string? productLine { get; set; }
        //产品工程师ID
        public string? engineerID { get; set; }
        //产品工程师名称
        public string? engineerName { get; set; }
        //项目经理ID
        public string? projectManagerID { get; set; }
        //项目经理名称
        public string? projectManagerName { get; set; }
        //计划工程师ID
        public string? planningEngineerID { get; set; }
        //计划工程师名称
        public string? planningEngineerName { get; set; }
        //试用单板/机柜编码
        public string? trialBoardCabinetCode { get; set; }
        //单板/机柜型号
        public string? singleBoardCabinetType { get; set; }
        //使用单板/机柜数量
        public string? usingSingleBoardCabinetCount { get; set; }
        //用量/PCS
        public string? dosagePCS { get; set; }
        //位号
        public string? tagNumber { get; set; }
    }


    //试用范围
    public class TrackMaterialTrackingDetails
    {
        //主键
        public int? key { get; set; }
        //试用单板/机柜编码
        public string? trialBoardCabinetCode { get; set; }
        //单板/机柜型号
        public string? singleBoardCabinetType { get; set; }
        //试用数量
        public string? usingSingleBoardCabinetCount { get; set; }
        //用量/PCS
        public string? dosagePCS { get; set; }
        //位号
        public string? tagNumber { get; set; }
        //链接
        public string? linkUrl { get; set; }
        //跟踪情况简要记录
        public string? summaryRecord { get; set; }
        //类型
        public string? addType { get; set; }
        //产品工程师ID
        public string? engineerID { get; set; }
        //产品工程师名称
        public string? engineerName { get; set; }
    }

    //主、子流程关联信息实体
    public class ProcessAssociatedInformationModel
    {
        //主键
        public Guid? Key { get; set; }
        //流程实例号
        public string? ProcInstId { get; set; }
        //单板/机柜编码
        public string? TrialBoardCabinetCode { get; set; }
        //单板/机柜型号
        public string? SingleBoardCabinetType { get; set; }
        //当前处理人
        public string? CurrentApprover { get; set; }
        //当前状态
        public string? CurrentState { get; set; }
        //流程单号
        public string? SerialNumber { get; set; }
        //发起时间
        public DateTime? CreatedDate { get; set; }
        //已滞留时间（天）
        public string? DetentionTime { get; set; }
        //流程类型
        public string? ProcessType { get; set; }
    }

    //会签信息
    public class CountersignInformationModel
    {
        //试制结论
        public bool? trialProductionConclusion { get; set; }
        //会签人名
        public string? countersignNane { get; set; }
        //成品处理方式
        public bool? finishProductHandlingMethod { get; set; }
        //原材料/半成品处理方式
        public string? rawMaterialHandlingMethod { get; set; }
        //限制范围/其他方式
        public string? restrictedScopeOtherMethods { get; set; }
        //意见
        public string? comment { get; set; }
        //后续操作
        public string? subsequentOperations { get; set; }
        //签署时间
        public string? signingTime { get; set; }
    }

    /// 查询条件
    /// </summary>
    public class SmallBatchTrialReportConditionModel
    {
        //流程状态
        public string? CurrentStatus { get; set; }
        //申请人
        public string? ApplicantEmployeeNumber { get; set; }
        //产品线
        public string? ProductLine { get; set; }
        //新物料编码
        public string? NewMaterialCode { get; set; }
        //原物料编码
        public string? RawMaterialCode { get; set; }
        //流程单号
        public string? ApplicationNumber { get; set; }
        //申请日期
        public string? ApplicantTime { get; set; }
        //试用来源
        public string? TrialSource { get; set; }
        public string? CurrentUser { get; set; }
        public int pageIndex { get; set; }
        public int pageSize { get; set; }
    }

    //新增/修改报表实体
    public class SmallBatchTrialReportDataModel
    {
        public Guid? SysId { get; set; }
        public string? ProcessFolio { get; set; }
        /// <summary>
        /// 流程实例号
        /// </summary>
        public string? ProcInstId { get; set; }
        /// <summary>
        /// 试用来源
        /// </summary>
        public string? TrialSource { get; set; }
        /// <summary>
        /// 物料替代电子流链接
        /// </summary>
        public string? ElectronicFlowLink { get; set; }
        /// <summary>
        /// 原物料编码
        /// </summary>
        public string? RawMaterialCode { get; set; }
        /// <summary>
        /// 原产品型号
        /// </summary>
        public string? RawProductType { get; set; }
        /// <summary>
        /// 原生产厂家
        /// </summary>
        public string? RawManufacturer { get; set; }
        /// <summary>
        /// 新物料编码
        /// </summary>
        public string? NewMaterialCode { get; set; }
        /// <summary>
        /// 新产品型号
        /// </summary>
        public string? NewProductType { get; set; }
        /// <summary>
        /// 新生产厂家
        /// </summary>
        public string? NewManufacturer { get; set; }
        /// <summary>
        /// OEM
        /// </summary>
        public bool? Oem { get; set; }
        /// <summary>
        /// 试制物料备料方
        /// </summary>
        public string? MaterialPreparationParty { get; set; }
        /// <summary>
        /// 试用背景
        /// </summary>
        public string? TrialBackground { get; set; }
        /// <summary>
        /// 试用目的
        /// </summary>
        public string? TrialObjective { get; set; }
        /// <summary>
        /// 试用加工过程重点关注事项
        /// </summary>
        public string? KeyConcerns { get; set; }
        /// <summary>
        /// 跟踪工程师
        /// </summary>
        public string? TrackingEngineer { get; set; }
        /// <summary>
        /// 器件工程师
        /// </summary>
        public string? ComponentEngineer { get; set; }
        /// <summary>
        /// 外协SQE
        /// </summary>
        public string? OutsourcingSQE { get; set; }
        /// <summary>
        /// 外协工艺工程师
        /// </summary>
        public string? OutsourcingEngineer { get; set; }
        /// <summary>
        /// 抄送人员
        /// </summary>
        public string? CCPersonnel { get; set; }
        /// <summary>
        /// SQE工程师
        /// </summary>
        public string? SQEEngineer { get; set; }
        /// <summary>
        /// 本次试制加工数量
        /// </summary>
        public string? Task1ThisProcessingCount { get; set; }
        /// <summary>
        /// 是否需要相关工程师审批
        /// </summary>
        public bool? Task1IsEngineerApproval { get; set; }
        /// <summary>
        /// 异常分析电子流
        /// </summary>
        public string? Task1AnomalyAnalysisProcess { get; set; }
        /// <summary>
        /// 异常是否与试制物料有关
        /// </summary>
        public bool? Task1IsAbnormalMaterialRelated { get; set; }
        /// <summary>
        /// 是否转产试制
        /// </summary>
        public bool? Task1IsTransitionToTrialProduction { get; set; }
        /// <summary>
        /// 审批人
        /// </summary>
        public string? Task1ApproveName { get; set; }
        /// <summary>
        /// 试制结论-Task3
        /// </summary>
        public bool? Task3TrialProductionConclusion { get; set; }
        /// <summary>
        /// 成品处理方式-Task3
        /// </summary>
        public bool? Task3FinishProductHandlingMethod { get; set; }
        /// <summary>
        /// 原材料/半成品处理方式-Task3
        /// </summary>
        public string? Task3RawMaterialHandlingMethod { get; set; }
        /// <summary>
        /// 后续操作-Task3
        /// </summary>
        public string? Task3SubsequentOperations { get; set; }
        /// <summary>
        /// 试制结论-Task4
        /// </summary>
        public bool? Task4TrialProductionConclusion { get; set; }
        /// <summary>
        /// 成品处理方式-Task4
        /// </summary>
        public bool? Task4FinishProductHandlingMethod { get; set; }
        /// <summary>
        /// 原材料处理方式-Task4
        /// </summary>
        public string? Task4RawMaterialHandlingMethod { get; set; }
        /// <summary>
        /// 半成品处理方式-Task4
        /// </summary>
        public string? Task4SemimanufacturesHandlingMethod { get; set; }
        /// <summary>
        /// 限制范围/其他方式-Task4
        /// </summary>
        public string? Task4RestrictedScopeOtherMethods { get; set; }
        /// <summary>
        /// 后续操作-Task4
        /// </summary>
        public string? Task4SubsequentOperations { get; set; }
        /// <summary>
        /// 是否需要总监审批-Task4
        /// </summary>
        public bool? Task4IsDirectorApproval { get; set; }
        /// <summary>
        /// 审批人-Task4
        /// </summary>
        public string? Task4ApproveName { get; set; }
        /// <summary>
        /// 试制结论-Task5
        /// </summary>
        public bool? Task5TrialProductionConclusion { get; set; }
        /// <summary>
        /// 成品处理方式-Task5
        /// </summary>
        public bool? Task5FinishProductHandlingMethod { get; set; }
        /// <summary>
        /// 原材料处理方式-Task5
        /// </summary>
        public string? Task5RawMaterialHandlingMethod { get; set; }
        /// <summary>
        /// 半成品处理方式-Task5
        /// </summary>
        public string? Task5SemimanufacturesHandlingMethod { get; set; }
        /// <summary>
        /// 限制范围/其他方式-Task5
        /// </summary>
        public string? Task5RestrictedScopeOtherMethods { get; set; }
        /// <summary>
        /// 后续操作-Task5
        /// </summary>
        public string? Task5SubsequentOperations { get; set; }
        //创建人
        public string? CreatedBy { get; set; }
        //创建日期
        public string? CreateDate { get; set; }
        //修改人
        public string? LastUpdatedBy { get; set; }
        //修改日期
        public string? LastUpdateDate { get; set; }
        //物料跟踪明细
        public List<MaterialTrackingDetails> materialTrackingDetailsList { get; set; } = new List<MaterialTrackingDetails>();
    }

    //加工-产品-人员配置数据(查询条件)
    public class ProductProcessingPersonnelConditionModel 
    {
        public string? key { get; set; }
        public int pageIndex { get; set; }
        public int pageSize { get; set; }
    }

    //产品线信息配置(查询条件)
    public class ProductLineDetailsConditionModel
    {
        public string? key { get; set; }
        public int pageIndex { get; set; }
        public int pageSize { get; set; }
    }

    //跟踪工程师信息
    public class SmallBatchTrialPrackingEngineerModel 
    {
        public string TrackingEngineerName { get; set; }
        public string TrackingEngineerID { get; set; }
    }

    //试用范围-确定稿
    public class DetermineTrackMaterialTrackingModel 
    {
        public string? ProcInstID { get; set; }
        public List<TrackMaterialTrackingDetails> determineTrackMaterialTracking { get; set; } = new List<TrackMaterialTrackingDetails>();
    }

}
